package org.csmzxy.class2334;
class DeviceController{
    private String controllername;
    public DeviceController(String controllername){
        this.controllername = controllername;
    }
    public void connectToDevice(){
        System.out.println("设备控制器成功连接到设备");
    }
    class Device{
        private String deviceName;
        public Device(String deviceName){
            this.deviceName = deviceName;
        }
        public void powerOn(){
            System.out.println(controllername + "控制" + deviceName + "开机！");
        }
        public void powerOff(){
            System.out.println(controllername + "控制" + deviceName + "关机！");
        }
    }
}
public class Example16 {
    public static void main(String[] args) {
        DeviceController controller = new DeviceController("设备控制器");
        controller.connectToDevice();
        DeviceController.Device device = controller.new Device("设备1");
        device.powerOn();
        device.powerOff();
    }
}
